const pool = require('../config/db');

/**
 * 口味模型
 */
const Taste = {
  /**
   * 查询所有口味
   */
  findAll: async () => {
    const [rows] = await pool.query(
      'SELECT taste_id, taste_name FROM tastes ORDER BY taste_id'
    );
    
    return rows.map(row => ({
      tasteId: row.taste_id,
      tasteName: row.taste_name
    }));
  }
};

module.exports = Taste;